<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/2/5
 * Time: 下午6:10
 */

namespace App\Markdown;

//支持markdown
class Markdown{
    protected $parser;

    /**
     * Markdown constructor.
     * @param $parser
     */
    public function __construct(Parser $parser)
    {
        $this->parser = $parser;
    }

    public function markdown($text)
    {
        //需要去命令行执行composer dump-autoload ,目的是为了加载我们导入的三方库
        $html = $this->parser->makeHtml($text);
        return $html;
    }

}